#!/usr/local/bin/tcsh
set Dir = /biomed-resimg/herc_tmp/tmp_conte/For_shkim/BIG-SCRATCH/IBIS-Autism-V12
set CCAtlasDir = /tools/CCsegmenter_autism/Model
set Outputfolder = /biomed-resimg/home/yben/test_output/IBIS

foreach imageT1 ($Dir/*/*/v12/stx/stx2*t1w-byte.nrrd)
        set dirt2 = $imageT1:h
	foreach imaget2 ($dirt2/Classify*t1w-byte*nrrd)
		CCsegtool -I $imageT1 -M $imaget2 -A $CCAtlasDir -O $Outputfolder --double --Unconstrained --sliceDir 0 --ComputeProbaModel
	end
end

montage -geometry 256x256+0+0 -bordercolor green -tile 10x10 $Outputfolder/*finalImage.png $Outputfolder/resultsmontage.jpg

exit 0
